package zhoug.player.core;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import androidx.annotation.IntDef;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE_USE;

/**
 * @Author: zhoug
 * @Date: 2023/1/6
 * @Description:
 */
public class PlayError {
    public static final int URL_IS_EMPTY = 5001;//playUrl为空
    public static final int URL_IS_ILLEGAL = 5002;//playUrl非法
    public static final int PLAYER_INIT_FAILURE = 5003;//初始化播放器失败
    public static final int UNKNOWN_ERROR = 5004;//未知错误
    public static final int NETWORK_CONNECTION_FAILED = 5005;//网络连接失败
    public static final int BAD_HTTP_STATUS = 5006;//错误的HTTP状态
    public static final int VIDEO_ENCODE_FAIL = 5007;//视频编码失败
    public static final int AUDIO_ENCODE_FAIL = 5008;//音频编码失败
    public static final int UNSUPPORTED_RESOLUTION = 5009;//不支持的视频分辨率
    public static final int URL_EXPIRE = 5010;//url过期
    public static final int IO_EXCEPTION = 5011;//取流异常
    public static final int TOKEN_EXPIRE = 5012;//token过期
    public static final int CONNECT_CAMERA_ERROR = 5013;//连接设备失败

    /**
     * 播放状态
     */
    @Documented
    @Retention(RetentionPolicy.SOURCE)
    @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE})
    @IntDef({URL_IS_EMPTY, URL_IS_ILLEGAL, PLAYER_INIT_FAILURE, UNKNOWN_ERROR, NETWORK_CONNECTION_FAILED,
            BAD_HTTP_STATUS, VIDEO_ENCODE_FAIL, AUDIO_ENCODE_FAIL, UNSUPPORTED_RESOLUTION,
            URL_EXPIRE, IO_EXCEPTION, TOKEN_EXPIRE})
    public @interface ErrorCode {

    }

}
